package com.esri.core.raster;

import com.esri.core.analysis.Function;
import java.util.Iterator;
import java.util.LinkedList;

/* loaded from: classes.dex */
public class FunctionRasterSource extends RasterSource {
    private static final long serialVersionUID = 1;
    private LinkedList<Function> a;

    public LinkedList<Function> getFunctions() {
        return this.a;
    }

    public void setFunctions(LinkedList<Function> linkedList) {
        this.a = linkedList;
    }

    @Override // com.esri.core.raster.RasterSource
    public long getId() {
        Function last;
        LinkedList<Function> linkedList = this.a;
        if (linkedList == null || linkedList.isEmpty() || (last = this.a.getLast()) == null) {
            return 0L;
        }
        return last.getId();
    }

    @Override // com.esri.core.raster.RasterSource
    public void dispose() {
        LinkedList<Function> linkedList = this.a;
        if (linkedList == null || linkedList.isEmpty()) {
            return;
        }
        Iterator<Function> it = this.a.iterator();
        while (it.hasNext()) {
            Function next = it.next();
            if (next != null) {
                next.dispose();
            }
        }
    }

    protected void finalize() throws Throwable {
        super.finalize();
        dispose();
    }
}
